/**
 * Created by Administrator on 2016/11/5.
 */

debugger;
window.onload=function() {
    var time;
    time = setInterval(t, 2000);
    var index = 0;
    var dd = document.getElementById('dd');
    var ss = document.getElementsByTagName('i');

    function t() {
        index++;
        if (index > ss.length) {
            index = 1;
        }
        go();
    }


    function go() {
        var a = document.getElementsByClassName('lun');
        if (index == 1) {
            a[0].style.display = 'block';
        } else if (index == 2) {
            a[0].style.display = 'none';
            a[1].style.display = 'block';
        } else if (index == 3) {
            a[0].style.display = 'none';
            a[1].style.display = 'none';
            a[2].style.display = 'block';
        } else if (index == 4) {
            a[0].style.display = 'none';
            a[1].style.display = 'none';
            a[2].style.display = 'none';
        }
        clear();
        if (index == ss.length) {
            ss[3].className = "item";
        } else {
            ss[index - 1].className = "item";
        }
    }

    for (var j = 0; j < ss.length; j++) {
            ss[j].onclick = function () {
                index = this.innerText;
                go();
            }
    }
    function clear() {
        for (var i = 0; i < ss.length; i++) {
            ss[i].className = "";
        }
    }




    document.getElementById('dengru').addEventListener('click', function () {
        var n =document.getElementById('username').value;
        var m =document.getElementById('password').value;
        if(n==""){
            document.getElementById('name').style.display='block'
        }else{
            if(m==""){
                document.getElementById('name').style.display='none';
                document.getElementById('word').style.display='block';
            }else{
                document.getElementById('name').style.display='none';
                document.getElementById('word').style.display='none';
            }
        }
    });
};